Skip to content

Add TransferFields SkipFieldsNotMatchingType guidance - #133

Merged
Jesper Schulz-Wedde (JesperSchulz) merged 4 commits into
microsoft:mainfrom
yahyatouil-dev:main
Aug 24, 2026
Merged

Add TransferFields SkipFieldsNotMatchingType guidance#133
Jesper Schulz-Wedde (JesperSchulz) merged 4 commits into
microsoft:mainfrom
yahyatouil-dev:main

Conversation

@yahyatouil-dev

Copy link
Copy Markdown
Contributor

What

One knowledge rule: don't use TransferFields(..., SkipFieldsNotMatchingType: true)
as a blanket way to keep two evolving tables transferring without
errors, when the destination actually depends on every source field
being copied.

Why this belongs in BCQuality

TransferFields only errors on a type mismatch when both tables are
in the same extension - cross-extension mismatches are already
skipped by default, flag or not. That distinction isn't obvious from
the method signature, and it's exactly the kind of thing where an AI
(or a dev in a hurry) reaches for SkipFieldsNotMatchingType = true
to make a compile/runtime error go away without noticing a field
silently stopped being copied.

Files

  • community/knowledge/data-modeling/transferfields-skip-type-mismatch-can-drop-data.md
  • .good.al - explicit field-by-field mapping with Evaluate for the
    type conversion, so a bad value fails loudly instead of vanishing
  • .bad.al - two tables in the same app, TransferFields(Source, true, true),
    Reference silently dropped because it's Code[20] on one side and
    Integer on the other

Verified against

  • Record.TransferFields(var Record, Boolean, Boolean) - Microsoft Learn
  • Confirmed the same-extension vs. cross-extension error behavior
    independently against community testing before writing the rule

One concern, one file, community layer.

@yahyatouil-dev

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two correctness gaps and one sample clarification.

@yahyatouil-dev

Copy link
Copy Markdown
Contributor Author

Jesper Schulz-Wedde (@JesperSchulz) all three points addressed in the latest commits, ready for another look whenever you have time.

Aligns the article with the repo convention used by the sibling data-modeling files: the .good.al reference belongs under Best Practice and the .bad.al reference under Anti Pattern. Previously both pointers sat under Anti Pattern, leaving the good-sample reference orphaned in the wrong section.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c998c71-f30b-40f3-b714-87fafed505d8
@JesperSchulz
Jesper Schulz-Wedde (JesperSchulz) merged commit 9fab601 into microsoft:main Aug 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants